package com.ldzy.config;


import com.ldzy.pojo.User;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


public class ResourcesInterceptor  implements HandlerInterceptor {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
        System.out.println("拦截器");
        User user=(User) request.getSession().getAttribute("USER_LOGIN");

        String url=request.getRequestURI();
        if (user!=null)
            return true;
        if(url.indexOf("login")>=0)
            return  true;
        System.out.println(111);
        return true;
    }

}
